<?php
/**
 * <pre>
 * <b>RUBIK IT Solution & Development ltd.</b>
 *
 * PROJECT      : rubik-base
 * COPYRIGHT    : 2008
 * ------------------------------------------------------
 * 
 * [GENERAL INFO OF THIS FILE] 
 *
 * </pre>
 * 
 * @version 		1.0
 * @author			Dang Nhon Hoa <hoadn@rubik.com.vn>
 * @access			public
 * @package			rubik.base.html
 *
 * Created on	: May 25, 2008
 */

class AbstractHtmlControl extends Object {
	
	var $_folder;
	
	/**
	 * Load langguage for module
	 *
	 * @param string $moduleName - Name of Module
	 * 
	 */
	function loadLanguage($langFile = null) {
		$lang = SystemSite::getLanguage ();
		$langPath = $this->_folder . DS . 'languages' . DS . "{$lang}.{$langFile}.lang.ini";
		return SysLanguage::loadLanguage ( $langPath );
	}
	
	/**
	 * Load template for Module
	 *
	 * @param string $templateFile - Name of template file
	 * @param string $tplExt the extenstion
	 * @return string the template content that can be use in string eval();
	 * 
	 */
	function loadTemplate($templateFile, $tplExt = ".tpl.html") {
		return SysTemplate::loadTemplate ( $templateFile, $this->_folder, $tplExt);
	}

	/**
	 * Load template for Module
	 *
	 * @param string $templateFile - Name of template file
	 * @param string $tplExt the extenstion
	 * @return string the template file path that can be use in required();
	 */
	function getTemplatePath($templateFile, $tplExt = ".tpl.php") {
		return SysTemplate::getTemplatePath( $templateFile, $this->_folder, $tplExt);
	}
}
?>